using System;
using System.Collections;
using System.Text;
using PetShop.Infrastructure.Gateways;
using PetShop.Domain.Model;

namespace PetShop.Domain.Services
{
    public class ProductServices
    {
        private readonly ProductGateway _gateway;

        public ProductServices()
        {
            _gateway = new ProductGateway();
        }

     
        public IList GetProductsByCategory(string category)
        {
            if (string.IsNullOrEmpty(category))
                return null;
            IList boGetProductsByCategory = _gateway.GetProductsByCategory(category);
            return boGetProductsByCategory;
        }

        public IList GetProductsBySearch(string text)
        {

            if (string.IsNullOrEmpty(text))
                return null;

            string[] keywords = text.Split();
            IList boGetProductsBySearch = _gateway.GetProductsBySearch(keywords);
            return boGetProductsBySearch;
        }
    }
}
